library(ggplot2)
library(gridExtra)
theme_set(theme_bw())

source('spatial.R')

innoc <- 1e6
param_c <- 10
X.ssa <- funk.run(1, innoc, param_c)
#print("big grid now ..")
#n <- 11
#X. <- funk.run(n)

source('../ode/basic.R')
X.ode <- basic.funk(innoc, c=param_c)

p <- list()
for(i in 1:3)
	p[[i]] <- substitute({
		ggplot() +
			geom_line(aes(X.ode[,1], X.ode[,i+1])) +
			geom_line(aes(X.ssa[,1], X.ssa[,i+1]), size=0.25, color='gray') +
			#geom_line(aes(X.[,1], X.[,1+(i-1)*n*n + (11-1)*n+11]), linetype=2) +
			#geom_line(aes(X.[,1], X.[,1+(i-1)*n*n + (3-1)*n+3]), linetype=3) +
			expand_limits(y=0) +
			ggtitle(c('Target cells','Infected cells','Free virus')[i]) +
			theme(axis.title.x=element_blank(), axis.title.y=element_blank())
		}, list(i=i))
do.call(grid.arrange, c(p, ncol=3))
